import Vue from 'vue'

import VueRouter from 'vue-router'

import Login from '@/view/login'
import Register from '@/view/register'
import Index from '@/view/index'

Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    {
      path: '/',
      redirect: '/login',
    },

    {
      name: 'Login',
      path: '/login',
      component: Login,
    },
    {
      name: 'Register',
      path: '/register',
      component: Register,
    },
    // {
    //   name: 'Register',
    //   path: '/register/:name',
    //   component: Register,
    // },
    {
      name: 'Index',
      path: '/index',
      component: Index,
    },
  ],
})

export default router
